bitkeeper revision 1.272 (3f056927K6c1zv1tNa8i4njBXcuuQg)
authorsos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Fri, 4 Jul 2003 11:46:47 +0000 (11:46 +0000)
committersos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Fri, 4 Jul 2003 11:46:47 +0000 (11:46 +0000)
Fix a random bunch of compiler warnings all over the tree.

14 files changed:
.rootkeys
BitKeeper/etc/ignore
xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c
xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c
xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c
xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c
xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c
xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c
xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c
xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c
xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c
xenolinux-2.4.21-sparse/arch/xeno/mm/init.c
xenolinux-2.4.21-sparse/include/asm-xeno/processor.h
xenolinux-2.4.21-sparse/include/linux/blk.h [new file with mode: 0644]

index d949706cb3c4d87e4b73c236119cf9afee6b0ecb..5b98352b81c2f189200ebdb6a4fdd5610e05f460 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 3e5a4e68uJz-xI0IBVMD7xRLQKJDFg xenolinux-2.4.21-sparse/include/asm-xeno/segment.h
 3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.21-sparse/include/asm-xeno/smp.h
 3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.21-sparse/include/asm-xeno/system.h
+3f056927gMHl7mWB89rb73JahbhQIA xenolinux-2.4.21-sparse/include/linux/blk.h
 3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.21-sparse/include/linux/major.h
 3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.21-sparse/include/linux/sunrpc/debug.h
 3e5a4e68W_hpMlM3u_-QOKMp3gzcwQ xenolinux-2.4.21-sparse/init/do_mounts.c
index a31719cbf1a632bf4cf40afe34a5c9e44c82fe71..b69356bdb40dca1a28c6313cce94629fd99f6b87 100644 (file)
@@ -426,3 +426,4 @@ xen/tools/figlet/figlet
 xenolinux-2.4.16-sparse/arch/xeno/drivers/block/Makefile.orig
 xenolinux-2.4.16-sparse/arch/xeno/drivers/block/block.c.orig
 xenolinux-2.4.16-sparse/scripts/kconfig.tk
+xenolinux-2.4.21-sparse/include/linux/blk.h~
index 4d7c42ecdbc40591462755ce93b3d680d7d5435d..714c6bf082f5f52710ee554c9cbbf012de056b39 100644 (file)
@@ -125,7 +125,7 @@ static void setup_major(struct gendisk **pgd,
         }
     }
 
-    return gd;
+    return;
 }
 
 
index f3d049238ff148ee4c6be2b0ed57a6df02d5491d..c0f389f181ee23e80ef309dc1ba17733fab27a95 100644 (file)
@@ -70,7 +70,7 @@ int xlscsi_init(xen_disk_info_t *xdi)
     blksize_size[XLSCSI_MAJOR]  = xlscsi_blksize_size;
     hardsect_size[XLSCSI_MAJOR] = xlscsi_hardsect_size;
     max_sectors[XLSCSI_MAJOR]   = xlscsi_max_sectors;
-    read_ahead[XLSCSI_MAJOR]    = NULL; //XXX8;
+    read_ahead[XLSCSI_MAJOR]    = 0; //XXX8;
 
     blk_init_queue(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR), do_xlblk_request);
 
index 59a3884de95659ab4a08d72e47831a483747bd7c..10bef3689291f020ed16c4bf6d5563521412a4ff 100644 (file)
@@ -10,6 +10,8 @@
 
 static struct proc_dir_entry *vhd;
 
+extern unsigned short xldev_to_physdev(kdev_t xldev);
+
 static int proc_read_vhd(char *page, char **start, off_t off,
                         int count, int *eof, void *data)
 {
index f38b021fb7cc8f6ffe55af7d4c12273173a2fb49..7ea44bd4c986204aa58422972919121d9c49b01b 100644 (file)
@@ -61,7 +61,9 @@ static kdev_t xen_console_device(struct console *c)
 }
 
 static struct console xen_console_info = {
-    name:              "xen_console",
+    name:              "xencons", /* Used to be xen_console, but we're only
+                                     actually allowed 8 charcters including
+                                     the terminator... */
     write:             xen_console_write,
     device:             xen_console_device,
     flags:             CON_PRINTBUFFER,
index f3eaeb4569876ecb1c1cedee455c4a43e900109c..90d60f7804cc08f4d56b06c7619f53f343d56aca 100644 (file)
@@ -64,7 +64,6 @@ extern struct file_operations dom0_phd_fops;
 
 struct proc_dir_entry *xeno_base;
 static struct proc_dir_entry *dom0_cmd_intf;
-static struct proc_dir_entry *proc_ft;
 static struct proc_dir_entry *dom_list_intf;
 
 unsigned long direct_mmap(unsigned long, unsigned long, pgprot_t, int, int);
@@ -341,8 +340,6 @@ static int cmd_write_proc(struct file *file, const char *buffer,
     int ret = 0;
     struct proc_dir_entry * new_dom_id;
     dom0_newdomain_t * params;
-    int i;
-    unsigned long p;
     
     copy_from_user(&op, buffer, sizeof(dom0_op_t));
 
@@ -359,7 +356,7 @@ static int cmd_write_proc(struct file *file, const char *buffer,
     }
     else if ( op.cmd == DO_PGUPDATES )
     {
-        ret = HYPERVISOR_pt_update(op.u.pgupdate.pgt_update_arr,
+        ret = HYPERVISOR_pt_update((void *)op.u.pgupdate.pgt_update_arr,
                                    op.u.pgupdate.num_pgt_updates);
     }
     else
@@ -460,7 +457,7 @@ static int xeno_domains_show(struct seq_file *s, void *v)
               di -> u.getdominfo.state,
               di -> u.getdominfo.hyp_events,
               di -> u.getdominfo.mcu_advance,
-              di -> u.getdominfo.pg_head,
+              (void *)di -> u.getdominfo.pg_head,
               di -> u.getdominfo.tot_pages,
               di -> u.getdominfo.name);
 
index 9d14070a1e6d4de6154fe95237a468f0990b7cda..282ada24dfd54d51859973f0f7bbfc97edf99160 100644 (file)
@@ -127,7 +127,7 @@ int direct_remap_disc_page_range(unsigned long from,
                 unsigned long first_pg, int tot_pages, pgprot_t prot)
 {
     dom0_op_t dom0_op;
-    unsigned long *pfns = get_free_page(GFP_KERNEL);
+    unsigned long *pfns = (unsigned long *)get_free_page(GFP_KERNEL);
     unsigned long start = from;
     int pages, i;
 
@@ -154,7 +154,7 @@ int direct_remap_disc_page_range(unsigned long from,
     }
 
 out:
-    free_page(pfns);
+    free_page((unsigned long)pfns);
     return tot_pages;
 } 
            
index 06cb7a356342bb0a5dde3bf4e4a00009a42a1a68..1bc9d0d17ed1041c69c5447d5ad8be52bc3434fd 100644 (file)
@@ -347,8 +347,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
  */
 void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 {
-    struct thread_struct *prev = &prev_p->thread,
-        *next = &next_p->thread;
+    struct thread_struct *next = &next_p->thread;
 
     __cli();
 
index c218067d2ab4862be07cbe55db47f614ba69e03b..e9c2fd5a1cf9e8874ce734d932be8ce2e9affaab 100644 (file)
@@ -168,7 +168,6 @@ void show_stack(unsigned long * esp)
 
 void show_registers(struct pt_regs *regs)
 {
-       int i;
        int in_kernel = 1;
        unsigned long esp;
        unsigned short ss;
@@ -200,19 +199,22 @@ void show_registers(struct pt_regs *regs)
                show_stack((unsigned long*)esp);
 
 #if 0
-               printk("\nCode: ");
-               if(regs->eip < PAGE_OFFSET)
-                       goto bad;
-
-               for(i=0;i<20;i++)
-               {
-                       unsigned char c;
-                       if(__get_user(c, &((unsigned char*)regs->eip)[i])) {
+                {
+                        int i;
+                       printk("\nCode: ");
+                       if(regs->eip < PAGE_OFFSET)
+                               goto bad;
+
+                       for(i=0;i<20;i++)
+                       {
+                               unsigned char c;
+                               if(__get_user(c, &((unsigned char*)regs->eip)[i])) {
 bad:
-                               printk(" Bad EIP value.");
-                               break;
+                                       printk(" Bad EIP value.");
+                                       break;
+                               }
+                               printk("%02x ", c);
                        }
-                       printk("%02x ", c);
                }
 #endif
        }
index d67ad51dc52c4520c17d2c4b24d7b8be335396e7..193559530782988c5d8a1492c16d7c45266859f0 100644 (file)
@@ -96,7 +96,7 @@ void MULTICALL_flush_page_update_queue(void)
 #if PT_UPDATE_DEBUG > 0
         DEBUG_allow_pt_reads();
 #endif
-        queue_multicall2(__HYPERVISOR_pt_update, update_queue, idx);
+        queue_multicall2(__HYPERVISOR_pt_update, (unsigned long)update_queue, idx);
         idx = 0;
     }
     spin_unlock_irqrestore(&update_lock, flags);
index 0806d775f7bfa99570ed43883be258ff071ebc7d..462e51c50107e5c2d2ad51d3c5fbabf9b77da92a 100644 (file)
@@ -284,7 +284,11 @@ static void __init set_max_mapnr_init(void)
 
 static int __init free_pages_init(void)
 {
-       int bad_ppro, reservedpages, pfn;
+#ifdef CONFIG_HIGHMEM
+#error Where is this supposed to be initialised?
+        int bad_ppro;
+#endif
+       int reservedpages, pfn;
 
        /* this will put all low memory onto the freelists */
        totalram_pages += free_all_bootmem();
index 3c4fa92b4188b5a30edb41b6424d340b63b75881..befcb4c410f184473ad2995a2b49c7a37d47b99a 100644 (file)
@@ -372,7 +372,7 @@ struct thread_struct {
 };
 
 #define INIT_THREAD  { sizeof(init_stack) + (long) &init_stack, \
-                       0, 0, 0, 0, 0, 0, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 }
+                       0, 0, 0, 0, 0, 0, {0}, 0, 0, 0, {{0}}, 0, 0, 0, 0, 0 }
 
 #define INIT_TSS  {                                            \
        0,0, /* back_link, __blh */                             \
diff --git a/xenolinux-2.4.21-sparse/include/linux/blk.h b/xenolinux-2.4.21-sparse/include/linux/blk.h
new file mode 100644 (file)
index 0000000..6f5a738
--- /dev/null
@@ -0,0 +1,411 @@
+#ifndef _BLK_H
+#define _BLK_H
+
+#include <linux/blkdev.h>
+#include <linux/locks.h>
+#include <linux/config.h>
+#include <linux/spinlock.h>
+
+/*
+ * Spinlock for protecting the request queue which
+ * is mucked around with in interrupts on potentially
+ * multiple CPU's..
+ */
+extern spinlock_t io_request_lock;
+
+/*
+ * Initialization functions.
+ */
+extern int isp16_init(void);
+extern int cdu31a_init(void);
+extern int acsi_init(void);
+extern int mcd_init(void);
+extern int mcdx_init(void);
+extern int sbpcd_init(void);
+extern int aztcd_init(void);
+extern int sony535_init(void);
+extern int gscd_init(void);
+extern int cm206_init(void);
+extern int optcd_init(void);
+extern int sjcd_init(void);
+extern int cdi_init(void);
+extern int hd_init(void);
+extern int ide_init(void);
+extern int xd_init(void);
+extern int mfm_init(void);
+extern int loop_init(void);
+extern int md_init(void);
+extern int ap_init(void);
+extern int ddv_init(void);
+extern int z2_init(void);
+extern int swim3_init(void);
+extern int swimiop_init(void);
+extern int amiga_floppy_init(void);
+extern int atari_floppy_init(void);
+extern int ez_init(void);
+extern int bpcd_init(void);
+extern int ps2esdi_init(void);
+extern int jsfd_init(void);
+extern int viodasd_init(void);
+extern int viocd_init(void);
+
+#if defined(CONFIG_ARCH_S390)
+extern int dasd_init(void);
+extern int xpram_init(void);
+extern int tapeblock_init(void);
+#endif /* CONFIG_ARCH_S390 */
+
+#if defined(CONFIG_XENOLINUX_BLOCK)
+extern int xlblk_init(void);
+extern int xlseg_init(void);
+extern int xlseg_proc_init(void);
+#endif /* CONFIG_ARCH_XENO */
+
+extern void set_device_ro(kdev_t dev,int flag);
+void add_blkdev_randomness(int major);
+
+extern int floppy_init(void);
+extern int rd_doload;          /* 1 = load ramdisk, 0 = don't load */
+extern int rd_prompt;          /* 1 = prompt for ramdisk, 0 = don't prompt */
+extern int rd_image_start;     /* starting block # of image */
+
+#ifdef CONFIG_BLK_DEV_INITRD
+
+#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */
+
+extern unsigned long initrd_start,initrd_end;
+extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < memory_start */
+void initrd_init(void);
+
+#endif
+
+                
+/*
+ * end_request() and friends. Must be called with the request queue spinlock
+ * acquired. All functions called within end_request() _must_be_ atomic.
+ *
+ * Several drivers define their own end_request and call
+ * end_that_request_first() and end_that_request_last()
+ * for parts of the original function. This prevents
+ * code duplication in drivers.
+ */
+
+static inline void blkdev_dequeue_request(struct request * req)
+{
+       list_del(&req->queue);
+}
+
+int end_that_request_first(struct request *req, int uptodate, char *name);
+void end_that_request_last(struct request *req);
+
+#if defined(MAJOR_NR) || defined(IDE_DRIVER)
+
+#undef DEVICE_ON
+#undef DEVICE_OFF
+
+/*
+ * Add entries as needed.
+ */
+
+#ifdef IDE_DRIVER
+
+#define DEVICE_NR(device)      (MINOR(device) >> PARTN_BITS)
+#define DEVICE_NAME "ide"
+
+#elif (MAJOR_NR == RAMDISK_MAJOR)
+
+/* ram disk */
+#define DEVICE_NAME "ramdisk"
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_NO_RANDOM
+
+#elif (MAJOR_NR == Z2RAM_MAJOR)
+
+/* Zorro II Ram */
+#define DEVICE_NAME "Z2RAM"
+#define DEVICE_REQUEST do_z2_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == FLOPPY_MAJOR)
+
+static void floppy_off(unsigned int nr);
+
+#define DEVICE_NAME "floppy"
+#define DEVICE_INTR do_floppy
+#define DEVICE_REQUEST do_fd_request
+#define DEVICE_NR(device) ( (MINOR(device) & 3) | ((MINOR(device) & 0x80 ) >> 5 ))
+#define DEVICE_OFF(device) floppy_off(DEVICE_NR(device))
+
+#elif (MAJOR_NR == HD_MAJOR)
+
+/* Hard disk:  timeout is 6 seconds. */
+#define DEVICE_NAME "hard disk"
+#define DEVICE_INTR do_hd
+#define TIMEOUT_VALUE (6*HZ)
+#define DEVICE_REQUEST do_hd_request
+#define DEVICE_NR(device) (MINOR(device)>>6)
+
+#elif (SCSI_DISK_MAJOR(MAJOR_NR))
+
+#define DEVICE_NAME "scsidisk"
+#define TIMEOUT_VALUE (2*HZ)
+#define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 4)) + (MINOR(device) >> 4))
+
+/* Kludge to use the same number for both char and block major numbers */
+#elif  (MAJOR_NR == MD_MAJOR) && defined(MD_DRIVER)
+
+#define DEVICE_NAME "Multiple devices driver"
+#define DEVICE_REQUEST do_md_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == SCSI_TAPE_MAJOR)
+
+#define DEVICE_NAME "scsitape"
+#define DEVICE_INTR do_st  
+#define DEVICE_NR(device) (MINOR(device) & 0x7f)
+
+#elif (MAJOR_NR == OSST_MAJOR)
+
+#define DEVICE_NAME "onstream" 
+#define DEVICE_INTR do_osst
+#define DEVICE_NR(device) (MINOR(device) & 0x7f) 
+#define DEVICE_ON(device) 
+#define DEVICE_OFF(device) 
+
+#elif (MAJOR_NR == SCSI_CDROM_MAJOR)
+
+#define DEVICE_NAME "CD-ROM"
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == XT_DISK_MAJOR)
+
+#define DEVICE_NAME "xt disk"
+#define DEVICE_REQUEST do_xd_request
+#define DEVICE_NR(device) (MINOR(device) >> 6)
+
+#elif (MAJOR_NR == PS2ESDI_MAJOR)
+
+#define DEVICE_NAME "PS/2 ESDI"
+#define DEVICE_REQUEST do_ps2esdi_request
+#define DEVICE_NR(device) (MINOR(device) >> 6)
+
+#elif (MAJOR_NR == CDU31A_CDROM_MAJOR)
+
+#define DEVICE_NAME "CDU31A"
+#define DEVICE_REQUEST do_cdu31a_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == ACSI_MAJOR) && (defined(CONFIG_ATARI_ACSI) || defined(CONFIG_ATARI_ACSI_MODULE))
+
+#define DEVICE_NAME "ACSI"
+#define DEVICE_INTR do_acsi
+#define DEVICE_REQUEST do_acsi_request
+#define DEVICE_NR(device) (MINOR(device) >> 4)
+
+#elif (MAJOR_NR == MITSUMI_CDROM_MAJOR)
+
+#define DEVICE_NAME "Mitsumi CD-ROM"
+/* #define DEVICE_INTR do_mcd */
+#define DEVICE_REQUEST do_mcd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == MITSUMI_X_CDROM_MAJOR)
+
+#define DEVICE_NAME "Mitsumi CD-ROM"
+/* #define DEVICE_INTR do_mcdx */
+#define DEVICE_REQUEST do_mcdx_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #1"
+#define DEVICE_REQUEST do_sbpcd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM2_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #2"
+#define DEVICE_REQUEST do_sbpcd2_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM3_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #3"
+#define DEVICE_REQUEST do_sbpcd3_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM4_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #4"
+#define DEVICE_REQUEST do_sbpcd4_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == AZTECH_CDROM_MAJOR)
+
+#define DEVICE_NAME "Aztech CD-ROM"
+#define DEVICE_REQUEST do_aztcd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == CDU535_CDROM_MAJOR)
+
+#define DEVICE_NAME "SONY-CDU535"
+#define DEVICE_INTR do_cdu535
+#define DEVICE_REQUEST do_cdu535_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == GOLDSTAR_CDROM_MAJOR)
+
+#define DEVICE_NAME "Goldstar R420"
+#define DEVICE_REQUEST do_gscd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == CM206_CDROM_MAJOR)
+#define DEVICE_NAME "Philips/LMS CD-ROM cm206"
+#define DEVICE_REQUEST do_cm206_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == OPTICS_CDROM_MAJOR)
+
+#define DEVICE_NAME "DOLPHIN 8000AT CD-ROM"
+#define DEVICE_REQUEST do_optcd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == SANYO_CDROM_MAJOR)
+
+#define DEVICE_NAME "Sanyo H94A CD-ROM"
+#define DEVICE_REQUEST do_sjcd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == APBLOCK_MAJOR)
+
+#define DEVICE_NAME "apblock"
+#define DEVICE_REQUEST ap_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == DDV_MAJOR)
+
+#define DEVICE_NAME "ddv"
+#define DEVICE_REQUEST ddv_request
+#define DEVICE_NR(device) (MINOR(device)>>PARTN_BITS)
+
+#elif (MAJOR_NR == MFM_ACORN_MAJOR)
+
+#define DEVICE_NAME "mfm disk"
+#define DEVICE_INTR do_mfm
+#define DEVICE_REQUEST do_mfm_request
+#define DEVICE_NR(device) (MINOR(device) >> 6)
+
+#elif (MAJOR_NR == NBD_MAJOR)
+
+#define DEVICE_NAME "nbd"
+#define DEVICE_REQUEST do_nbd_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == MDISK_MAJOR)
+
+#define DEVICE_NAME "mdisk"
+#define DEVICE_REQUEST mdisk_request
+#define DEVICE_NR(device) (MINOR(device))
+
+#elif (MAJOR_NR == DASD_MAJOR)
+
+#define DEVICE_NAME "dasd"
+#define DEVICE_REQUEST do_dasd_request
+#define DEVICE_NR(device) (MINOR(device) >> PARTN_BITS)
+
+#elif (MAJOR_NR == I2O_MAJOR)
+
+#define DEVICE_NAME "I2O block"
+#define DEVICE_REQUEST i2ob_request
+#define DEVICE_NR(device) (MINOR(device)>>4)
+
+#elif (MAJOR_NR == COMPAQ_SMART2_MAJOR)
+
+#define DEVICE_NAME "ida"
+#define TIMEOUT_VALUE (25*HZ)
+#define DEVICE_REQUEST do_ida_request
+#define DEVICE_NR(device) (MINOR(device) >> 4)
+
+#endif /* MAJOR_NR == whatever */
+
+/* provide DEVICE_xxx defaults, if not explicitly defined
+ * above in the MAJOR_NR==xxx if-elif tree */
+#ifndef DEVICE_ON
+#define DEVICE_ON(device) do {} while (0)
+#endif
+#ifndef DEVICE_OFF
+#define DEVICE_OFF(device) do {} while (0)
+#endif
+
+#if (MAJOR_NR != SCSI_TAPE_MAJOR) && (MAJOR_NR != OSST_MAJOR)
+#if !defined(IDE_DRIVER)
+
+#ifndef CURRENT
+#define CURRENT blkdev_entry_next_request(&blk_dev[MAJOR_NR].request_queue.queue_head)
+#endif
+#ifndef QUEUE_EMPTY
+#define QUEUE_EMPTY list_empty(&blk_dev[MAJOR_NR].request_queue.queue_head)
+#endif
+
+#ifndef DEVICE_NAME
+#define DEVICE_NAME "unknown"
+#endif
+
+#define CURRENT_DEV DEVICE_NR(CURRENT->rq_dev)
+
+#ifdef DEVICE_INTR
+static void (*DEVICE_INTR)(void) = NULL;
+#endif
+
+#define SET_INTR(x) (DEVICE_INTR = (x))
+
+#ifdef DEVICE_REQUEST
+static void (DEVICE_REQUEST)(request_queue_t *);
+#endif 
+  
+#ifdef DEVICE_INTR
+#define CLEAR_INTR SET_INTR(NULL)
+#else
+#define CLEAR_INTR
+#endif
+
+#define INIT_REQUEST \
+       if (QUEUE_EMPTY) {\
+               CLEAR_INTR; \
+               return; \
+       } \
+       if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) \
+               panic(DEVICE_NAME ": request list destroyed"); \
+       if (CURRENT->bh) { \
+               if (!buffer_locked(CURRENT->bh)) \
+                       panic(DEVICE_NAME ": block not locked"); \
+       }
+
+#endif /* !defined(IDE_DRIVER) */
+
+
+#ifndef LOCAL_END_REQUEST      /* If we have our own end_request, we do not want to include this mess */
+
+#if ! SCSI_BLK_MAJOR(MAJOR_NR) && (MAJOR_NR != COMPAQ_SMART2_MAJOR)
+
+static inline void end_request(int uptodate) {
+       struct request *req = CURRENT;
+
+       if (end_that_request_first(req, uptodate, DEVICE_NAME))
+               return;
+
+#ifndef DEVICE_NO_RANDOM
+       add_blkdev_randomness(MAJOR(req->rq_dev));
+#endif
+       DEVICE_OFF(req->rq_dev);
+       blkdev_dequeue_request(req);
+       end_that_request_last(req);
+}
+
+#endif /* ! SCSI_BLK_MAJOR(MAJOR_NR) */
+#endif /* LOCAL_END_REQUEST */
+
+#endif /* (MAJOR_NR != SCSI_TAPE_MAJOR) */
+#endif /* defined(MAJOR_NR) || defined(IDE_DRIVER) */
+
+#endif /* _BLK_H */